package StarRank;

import java.io.IOException;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import com.alibaba.fastjson.JSON;

public class StarRankMapper extends Mapper< LongWritable, Text, MovieInfo, NullWritable > {
    protected void map(LongWritable k1, Text v1, Context context)
            throws IOException, InterruptedException {
        //数据
        String json = v1.toString();
        MovieInfo mi=JSON.parseObject(json,MovieInfo.class);
        //输出
        if (mi.getActor().contains("郑佩佩")){
            context.write(mi,NullWritable.get());
        }
    }
}
